package com.mall.admin.controller;

import com.mall.admin.service.SmsCouponHistoryService;
import com.mall.commons.utils.PageResult;
import com.mall.commons.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/couponHistory")
public class SmsCouponHistoryController {

    @Autowired
    private SmsCouponHistoryService smsCouponHistoryService;

    //根据优惠券id，使用状态，订单编号分页获取领取记录
    @GetMapping("/list")
    public R list(Long couponId,String orderSn,Integer pageNum,Integer pageSize,Integer useStatus){
        PageResult pageResult = smsCouponHistoryService.list(couponId,orderSn,pageNum,pageSize,useStatus);
        return R.success("获取领取记录",pageResult);
    }
}
